package com.zero.demo.jms.enums;


/**
 * @Discription 通用接口返回值枚举
 * @Project framework
 * @Author yangaj
 * @Date 2018年12月05日
 */

public enum ResultCodeEnum {

    /* 成功状态码 */
    SUCCESS(200, "成功"),
    /**
     * 失败
     */
    FAILURE(500, "操作失败"),SELECT_FAILURE(501, "查询失败"),INSERT_FAILURE(502, "新增失败"),UPDATE_FAILURE(503, "修改失败"),DELETE_FAILURE(504, "删除失败"),

    /* 参数错误：10001-19999 */
    PARAM_IS_INVALID(10001, "参数无效"), PARAM_IS_BLANK(10002, "参数为空"), PARAM_TYPE_BIND_ERROR(10003, "参数类型错误"), PARAM_NOT_COMPLETE(10004, "参数缺失"),

    /* 用户错误：20001-29999*/
    AUTH_PARAM_ERROR(20000, "认证请求"),USER_NOT_LOGGED_IN(20001, "用户未登录"), USER_LOGIN_ERROR(20002, "账号不存在或密码错误"), USER_ACCOUNT_FORBIDDEN(20003, "账号已被禁用"), USER_NOT_EXIST(20004, "用户不存在"), USER_HAS_EXISTED(20005, "用户已存在"),USER_EXPIRED(20006, "会话失效"),AUTH_TOKEN(20007, "认证失败"),

    /* 字典表查询  30000*/
    DICT_QUERY_ERROR(30000,"字典查询失败"),

    /* 业务错误：30001-39999 */
    UPLOAD_ERROR(30001,"上传异常"),CODE_ERROR(30002,"验证码不正确"),CODE_NO_EXIED(30002,"请输入验证码"),
    /* 系统错误：40001-49999 */
    SYSTEM_INNER_ERROR(40001, "系统繁忙，请稍后重试"),

    /* 数据错误：50001-599999 */
    RESULE_DATA_NONE(50001, "数据未找到"), DATA_IS_WRONG(50002, "数据有误"), DATA_ALREADY_EXISTED(50003, "数据已存在"), FORM_REPEAT_SUMBIT(50004, "表单重复提交"),

    /* 接口错误：60001-69999 */
    INTERFACE_INNER_INVOKE_ERROR(60001, "内部系统接口调用异常"), INTERFACE_OUTTER_INVOKE_ERROR(60002, "外部系统接口调用异常"), INTERFACE_FORBID_VISIT(60003, "该接口禁止访问"), INTERFACE_ADDRESS_INVALID(60004, "接口地址无效"), INTERFACE_REQUEST_TIMEOUT(60005, "接口请求超时"), INTERFACE_EXCEED_LOAD(60006, "接口负载过高"),

    /* 权限错误：70001-79999 */
    PERMISSION_NO_ACCESS(70001, "无访问权限");


    private int id;

    private String msg;

    private ResultCodeEnum(int id, String name) {
        this.id = id;
        this.msg = name;
    }

    public int getCode() {
        return id;
    }

    public String getMsg() {
        return msg;
    }

}